﻿using Li.EntityFramework.IAppService;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Li.EntityFramework.IRepository;
using Li.EntityFramework.Repository;

namespace Li.EntityFramework.AppService
{
    public class BaseAppService<TEntity> : BaseRepository<TEntity>, IBaseAppService<TEntity> where TEntity : class
    {
        public void Delete(TEntity entity)
        {
            db.Set<TEntity>().Remove(entity);
        }

        public IEnumerable<TEntity> GetAll()
        {
            return db.Set<TEntity>();
        }

        public int SaveChanges()
        {
            return db.SaveChanges();
        }
    }
}
